package org.lc.stk.model.question.impl.choice;

import java.util.List;

import org.hibernate.annotations.Comment;
import org.lc.stk.model.question.QuestionStem;

import jakarta.persistence.CascadeType;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Lob;
import jakarta.persistence.OneToMany;
import jakarta.persistence.OrderBy;
import jakarta.persistence.Table;

/**
 * 选择题的题干。目前采用单项选择与多项选择共用相同的题干
 */
@Entity
@Table(name = "choice_question_stem")
@Comment("选择题的题干")
public class ChoiceQuestionStem extends QuestionStem {

    /**
     * 选择题问题
     */
    @Lob
    @Column(nullable = false)
    @Comment("选择题问题")
    private String stem;

    @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true)
    @OrderBy("id ASC")
    @Comment("选项列表")
    private List<Option> optionList;

    public String getStem() {
        return stem;
    }

    public void setStem(String stem) {
        this.stem = stem;
    }

    public List<Option> getOptionList() {
        return optionList;
    }

    public void setOptionList(List<Option> optionList) {
        this.optionList = optionList;
    }
}
